<?php
/**
 * Copyright (C), 2016-2018, Shall Buy Life info. Co., Ltd.
 * FileName:EcService.php
 * Description: 说明
 *
 * @author lwl
 * @Create Date 2021/12/20 10:26:09
 * @Update Date 2021/12/20 10:26:09
 * @version v1.0
 */
declare(strict_types=1);

namespace Example\Services\Inner;

final class OrderService
{

    /**
     * FunctionName：detail
     * Description：主订单需要的详情
     * Author：lwl
     */
    public function detail(string $orderSn)
    {
        return Order::query()->where('order_sn',$orderSn)->first();
    }

    /**
     * FunctionName：confirm
     * Description：主订单需要
     * Author：lwl
     * @return \int[][][][]
     */
    public function confirm():array
    {
        $amount = 100;
        return [
            'order' => [
                'confirm' => [
                    [
                        'storeid' => 0,
                        'deduct_coin' => 0,
                        'actual_amount' => $amount,
                        'order_amount' => $amount,
                        'return_credits' => $amount,
                        'deduct_credits' => 0,
                        'deduct_active' => 0,
                        'total_amount' => $amount,
                        'store_service_rate' => 1,
                    ]
                ]
            ]
        ];
    }
}
